<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
  </head>
  <style>
    ul {
      list-style: none;
    }
    li {
      height: 40px;
      border: 1px solid #000;
    }
  </style>
  <body>
    <ul id="list1">
      <li>red</li>
      <li class="red">red</li>
      <li>red</li>
      <li>red</li>
      <li>red</li>
    </ul>
    <ul id="list2">
      <li>red</li>
      <li>red</li>
      <li class="red">red</li>
      <li>red</li>
      <li>red</li>
    </ul>

    <script>
      $('#list1').css('background', 'green');
      $('.red').css('background', 'gray');
    </script>
  </body>
</html>
